﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.Mirror.Ia32
{
	public class JumpTarget : Operand
	{
		public JumpTarget(
			long sourceOffset,
			long targetOffset
			)
			: base(OperandSize.Dword)
		{
			this.SourceOffset = sourceOffset;
			this.TargetOffset = targetOffset;
		}

		public override string ToString()
		{
			string format;
			if (this.TargetOffset <= UInt32.MaxValue)
				format = "0{0:X8}h";
			else
				format = "0{0:X16}h";

			return string.Format(format, this.TargetOffset);
		}

		public long SourceOffset { get; private set; }
		public long TargetOffset { get; private set; }
	}
}
